use hypers::prelude::*;
use hypers::tracing::info;

#[tokio::main]
async fn main() -> Result<()> {
    tracing_subscriber::fmt().init();
    let mut root: Router = Router::default();
    let static_file = StaticFile::new("static_file/src/main.rs");
    root.get("/static_file", static_file);
    info!("root = {:#?}", root);
    // http://127.0.0.1:7878/static_file
    let listener = hypers::TcpListener::bind("127.0.0.1:7878").await?;
    hypers::listen(root,listener).await
}

